Round robin scheduling is a scheduling manner for scheduling elements in a service queue by using a round robin method. To ensure a balance in round robin scheduling of the elements in the service queue, location information of a scheduled element when each time of round robin scheduling ends needs to be recorded, so as to use a next location following the location as a starting location of a next time of round robin scheduling.
In an actual application, generally one application service corresponds to multiple service queues, and each service queue further includes multiple service elements. In the prior art, when round robin scheduling is performed on the service elements in each service queue, generally a storage unit is allocated to each service queue. For example, in an application of a router, one router needs to perform traffic management on services of multiple users, and a service of each user further includes multiple types of service flows. To ensure quality of service for each user, bandwidth is allocated among the multiple types of service flows inside each user by means of round robin scheduling. It is assumed that one router can support use by 64K (64*1024) users at the same time, and each user has 8 types of service flows. In this case, a 3-bit storage unit needs to be allocated to each user, and 64K users need a total of 64K 3-bit storage units.
Therefore, in this solution for implementing round robin scheduling provided by the prior art, when there are a large quantity of users, a large quantity of storage units are needed to store ending location information of the corresponding round robin scheduling, leading to a high cost of storage devices.